package com.hdy.demo.anotation.action;

import javax.annotation.Resource;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.hdy.demo.anotation.service.MyAnotationService;
import com.hdy.framework.struts2.action.BaseAction;

/*
	by 何栋宇
	2013-1-30
	http://127.0.0.1/ssh/anotation/in.action
 */
//
@Scope("prototype")
@Component("myAnotationAction")
public class MyAnotationAction extends BaseAction implements InitializingBean{
	@Resource(name="myAnotationService")//放在属性可以省略get set方法 也可以放在set方法前面
	private MyAnotationService myAnotationService;
	private String returnStr;
	@Override
	public String execute() {
		returnStr=this.myAnotationService.testAop();
		return SUCCESS;
	}
	public String getReturnStr() {
		return returnStr;
	}
	public void setReturnStr(String returnStr) {
		this.returnStr = returnStr;
	}
	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("初始化MyAnotationAction成功");
	}
}
